(Array.prototype as any).myMap = function (callBack: any, thisArgs: any) {
  if (this == null) {
    throw new TypeError('this is null or undefined');
  }
  if (typeof callBack !== 'function') {
    throw new TypeError(callBack + 'is not a function');
  }

  const o = Object(this);
  const len = o.length >>> 0;
  const res = [];
  let step = 0;

  while (step < len) {
    const v = callBack.call(thisArgs, o[step], step, o);
    // @ts-ignore
    res.push(v);
    step++;
  }

  return res;
};
